import http from './index'
export default {
  // 登录 {username,password}
  toLogin(data){
    return new Promise((resolve,reject) => {
      http('post','/verify/login',data).then(
        (res)=>{resolve(res)},
        (error)=>{reject(error)}
      )
    })
  },

  // 退出登录 {username}
  toLogout(data){
    return new Promise((resolve,reject) => {
      http('post','/verify/logout',data).then(
        (res)=>{resolve(res)},
        (error)=>{reject(error)}
      )
    })
  },

  //注册
  toSignin(data){
    return new Promise((resolve,reject) => {
      http('post','/verify/signin',data).then(
        (res)=>{resolve(res)},
        (error)=>{reject(error)}
      )
    })
  },

  // 检查是否重名
  checkName(data){
    return new Promise((resolve,reject) => {
      http('post','/verify/checkName',data).then(
        (res)=>{resolve(res)},
        (error)=>{reject(error)}
      )
    })
  }
}
